06. 创建 ndarray
Start Quiz:
import numpy as np
# Using the Built-in functions you learned about in the
# previous lesson, create a 4 x 4 ndarray that only
# contains consecutive even numbers from 2 to 32 (inclusive)
X =
import numpy as np
X = np.arange(2,34,2).reshape(4,4)
INSTRUCTOR NOTE:
尝试使用
np.linspace()
功能来创建相同的array。答案如下:
np.linspace(2,32,16).reshape(4,4)